package com.navinfo.data.esper.cep.marketdatafeed;

import com.espertech.esper.client.EventBean;
import com.espertech.esper.client.UpdateListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RatePatternListener  implements UpdateListener {
    public EventBean getLastEvent() {
        return lastEvent;
    }

    private EventBean lastEvent;

    public void update(EventBean[] newEvents, EventBean[] oldEvents) {
        log.info("RatePatternListener======================================");
        if (newEvents != null) {
            for (int i = 0; i < newEvents.length; i++) {
//                log.info("=========a: " + ((MarketDataEvent) newEvents[i].get("a")).getFeed());
                log.info("=============+++++++++++++++++++++++b: " + ((MarketDataEvent) newEvents[i].get("b")).getFeed());
            }
            lastEvent = newEvents[0];
        }
    }

    private static final Logger log = LoggerFactory.getLogger(RatePatternListener.class);
}